package com.example.smartcity.ui.AcNews

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import androidx.lifecycle.ViewModel
import com.example.smartcity.logic.Repository
import com.example.smartcity.logic.model.Comments

class NewSFlashShowActivityViewModel : ViewModel() {
    /**
     * 新闻评论
     */
    private val newsCommentData = MutableLiveData<Int>()
    val newsCommentList = ArrayList<Comments.Rows>()
    val newsCommentLiveData = Transformations.switchMap(newsCommentData){
        Repository.getComment()
    }
    fun setComments(id: Int){
        newsCommentData.value = id
    }
}